 /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUI;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.*;
/**
 *
 * @author Carter
 */
public class DesireOpt  {
    JFrame j;
    JTextField x;
    JTextField y;
    JTextField z;
    JLabel lx;
    JLabel ly;
    JLabel lz;
    JButton done;
    double data;
    double xVal = 0;
    double yVal = 0;
    double zVal = 0;

    public DesireOpt(){
        j = new JFrame("Desired Point");
        x = new JTextField();
        y = new JTextField();
        z = new JTextField();
        lx = new JLabel("x");
        ly = new JLabel("y");
        lz = new JLabel("z");
        done = new JButton("Done");
        j.setLayout(null);
        j.setSize(300,400);
        x.setBounds(j.getWidth()/2,50,100,25);
        y.setBounds(j.getWidth()/2,100,100,25);
        z.setBounds(j.getWidth()/2,150,100,25);
        lx.setBounds(-10+(j.getWidth()/2),50,10,15);
        ly.setBounds(-10+(j.getWidth()/2),100,10,15);
        lz.setBounds(-10+(j.getWidth()/2),150,10,15);
        done.setBounds(j.getWidth()/2,200,100,25);
        j.add(x);
        j.add(y);
        j.add(z);
        j.add(lx);
        j.add(ly);
        j.add(lz);
        j.add(done);
        j.setSize(300,400);
        j.setVisible(false);
        done.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                getX();
                getY();
                getZ();
                j.setVisible(false);
                
            }
        });
        
    }
    
    public void getX(){
         xVal = Double.parseDouble(x.getText());
        
    }
    public void getY(){
         yVal = Double.parseDouble(y.getText());
        
    }
    public void getZ(){
         zVal = Double.parseDouble(z.getText());
        
    }

}
